package cn.zou.core.shiro.realm;

import org.apache.shiro.crypto.hash.SimpleHash;


public class ShiroEncryptionUtils {
	public static final String algorithmNameMD5="MD5";
	public static final String algorithmNameMD2="MD2";
	public static String HashPassword(String password,String algorithmName){
		
		SimpleHash simpleHash = new SimpleHash(algorithmName, password, MyRealm.credentialsSalt, MyRealm.HashIterations);
		return simpleHash.toString();
	}
	public static void main(String[] args) {
		System.out.println(HashPassword("123456",algorithmNameMD5));
		
	}		
}
